package com.example.controller;

import com.example.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class Ten {

    @Autowired
    private StudentService studentService;


    @ResponseBody
    @RequestMapping("/ten")
    public Object redisTest01(String key,String value){
        studentService.put(key,value);
        return "ok!";
    }

    @ResponseBody
    @RequestMapping("/ten2")
    public Object redisTest02(String key){
        String s = studentService.get(key);
        return "ok!,"+s;
    }
}
